







![]() ![]() |
CuttingEdge.Conditions reference library |
ValidatorExtensions..::.DoesNotContain<(Of <(TCollection, TElement>)>) Method (ConditionValidator<(Of <(TCollection>)>), TElement) |
ValidatorExtensions Class See Also Send Feedback |
Checks whether the given value does not contain the specified element. An
exception is thrown otherwise. When the value is a null reference it is considered empty and
therefore won't contain element.
Namespace:
CuttingEdge.Conditions
Assembly:
CuttingEdge.Conditions (in CuttingEdge.Conditions.dll)
Syntax
Visual Basic (Declaration) |
---|
Public Shared Function DoesNotContain(Of TCollection As IEnumerable(Of TElement), TElement) ( _ validator As ConditionValidator(Of TCollection), _ element As TElement _ ) As ConditionValidator(Of TCollection) |
C# |
---|
public static ConditionValidator<TCollection> DoesNotContain<TCollection, TElement>( ConditionValidator<TCollection> validator, TElement element ) where TCollection : IEnumerable<TElement> |
Visual C++ |
---|
public: generic<typename TCollection, typename TElement> where TCollection : IEnumerable<TElement> static ConditionValidator<TCollection>^ DoesNotContain( ConditionValidator<TCollection>^ validator, TElement element ) |
JavaScript |
---|
JavaScript does not support generic types or methods. |
Parameters
- validator
- Type: CuttingEdge.Conditions..::.ConditionValidator<(Of <(TCollection>)>)
The ConditionValidator<(Of <(T>)>) that holds the value that has to be checked.
- element
- Type: TElement
The element that should contain the given value.
Type Parameters
- TCollection
- The type of the value to check.
- TElement
- The type that can be considered an element of the TCollection.
Return Value
The specified validator instance.
Exceptions
Exception | Condition |
---|---|
System..::.ArgumentException | Thrown when the Value of the specified validator does contain element, while the specified validator is created using the Requires extension method. |
CuttingEdge.Conditions..::.PostconditionException | Thrown when the Value of the specified validator does contain element, while the specified validator is created using the Ensures extension method. |